From 0c87b6225142cb97e1ffa763bca26ee0e1b8f717 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 18 Apr 2019 00:12:34 +0000 Subject: [PATCH] Survive absence of librsvg without criticals We can't guarantee that we can load svgs, so we shouldn't spew criticals when some of our own resources fail to load due to that reason. --- gtk/tools/gdkpixbufutils.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gtk/tools/gdkpixbufutils.c b/gtk/tools/gdkpixbufutils.c index 0ed23bd3dc..0f4b7f09b5 100644 --- a/gtk/tools/gdkpixbufutils.c +++ b/gtk/tools/gdkpixbufutils.c @@ -364,11 +364,14 @@ gtk_make_symbolic_texture_from_resource (const char *path, GError **error) { GdkPixbuf *pixbuf; - GdkTexture *texture; + GdkTexture *texture = NULL; pixbuf = gtk_make_symbolic_pixbuf_from_resource (path, width, height, scale, error); - texture = gdk_texture_new_for_pixbuf (pixbuf); - g_object_unref (pixbuf); + if (pixbuf) + { + texture = gdk_texture_new_for_pixbuf (pixbuf); + g_object_unref (pixbuf); + } return texture; } -- 2.30.2